package pri.damai.xiaowu.anydoor.netty.codec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import pri.damai.xiaowu.anydoor.business.BaseModel;
import pri.damai.xiaowu.anydoor.util.BizCodecUtils;

/**
 * 编码器
 *
 * @description
 * @author YangXinFu
 * @date 9:27 2022/7/25
 **/
public class BizModelEncoder extends MessageToByteEncoder<BaseModel> {
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, BaseModel baseModel, ByteBuf byteBuf) throws Exception {
        BizCodecUtils.encode(baseModel, byteBuf);
    }
}
